import { reactive } from 'vue'

export const siteConfig = reactive({
  // 基本信息
  basic: {
    name: '花生了什么树',
    englishName: 'Allen',
    title: '.NET开发工程师',
    motto: '这个世界是不公平的，你要学着去习惯它。',
    location: '中国，浙江省，金华市',
    email: 'hongjy1991@outlook.com',
    resumeLink: '/resume.pdf'
  },

  // 社交媒体链接
  social: {
    github: 'https://github.com/allenhongjun',
    linkedin: 'https://linkedin.com/in/hongjy',
    blog: 'https://blog.hongjy.cn'
  },

  // 工作经历
  workExperience: [
    {
      id: 1,
      period: '2023 - 至今',
      title: '全栈开发工程师',
      company: '某科技有限公司',
      achievements: [
        '负责公司核心产品的前后端开发维护',
        '优化系统性能，提升用户体验',
        '参与技术架构设计和技术选型'
      ]
    },
    {
      id: 2,
      period: '2021 - 2022',
      title: '.NET开发工程师',
      company: '某网络科技公司',
      achievements: [
        '参与跨境电商营销项目的开发',
        '实现复杂的数据查询接口功能',
        '开发和维护公司帮助类库'
      ]
    },
    {
      id: 3,
      period: '2019 - 2021',
      title: '.NET开发工程师',
      company: '某互联网公司',
      achievements: [
        '负责公司电商平台的后端开发',
        '负责移动端项目后端接口开发',
        '优化后端构建流程'
      ]
    },
    
  ],

  // 项目展示
  projects: [
    {
      id: 1,
      title: '教学管理系统',
      description: '基于Vue3和Node.js的现代化博客系统',
      image: 'http://express.zjsirui.cn/UploadFiles/201909/26/201909261610583878.png',
      category: '全栈',
      technologies: ['Asp.NET', 'jquery', 'SqlServer'],
      demo: 'http://express.zjsirui.cn/',
      github: '#'
    },
    {
      id: 2,
      title: '生鲜电商平台',
      description: '企业级生鲜电商购物平台',
      image: 'https://img.xiaben.com/xiabenhome/images/20200820140424_2405.png',
      category: '后端',
      technologies: ['.NET', 'Echart', 'Redis'],
      demo: 'https://xiaben.com/abou-xb.html',
      github: '#'
    }
    
  ],

  // 代码片段
  codeSnippets: [
    {
      id: 1,
      title: 'Vue3 Composition API 示例',
      description: '使用 Vue3 组合式 API 的最佳实践',
      language: 'javascript',
      code: `
import { ref, onMounted } from 'vue'

export default {
  setup() {
    const count = ref(0)
    const increment = () => count.value++
    
    onMounted(() => {
      console.log('组件已挂载')
    })
    
    return {
      count,
      increment
    }
  }
}`,
      tags: ['Vue3', 'Composition API', '最佳实践'],
      version: '1.0.0'
    },
    {
      id: 2,
      title: '自定义 Hook',
      description: '封装常用的业务逻辑',
      language: 'javascript',
      code: `
import { ref } from 'vue'

export function useCounter(initialValue = 0) {
  const count = ref(initialValue)
  
  const increment = () => count.value++
  const decrement = () => count.value--
  const reset = () => count.value = initialValue
  
  return {
    count,
    increment,
    decrement,
    reset
  }
}`,
      tags: ['Vue3', 'Hooks', '代码复用'],
      version: '1.0.0'
    },
    {
      id: 3,
      title: '防抖函数',
      description: '实现防抖功能的工具函数',
      language: 'javascript',
      code: `
export function debounce(fn, delay) {
  let timer = null
  return function (...args) {
    if (timer) clearTimeout(timer)
    timer = setTimeout(() => {
      fn.apply(this, args)
    }, delay)
  }
}

// 使用示例
const debouncedSearch = debounce((query) => {
  console.log('搜索:', query)
}, 300)`,
      tags: ['JavaScript', '工具函数', '性能优化'],
      version: '1.0.0'
    },
    {
      id: 4,
      title: 'Vue3 状态管理',
      description: '使用 Pinia 进行状态管理',
      language: 'javascript',
      code: `
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    name: '',
    token: '',
    roles: []
  }),
  
  getters: {
    isLoggedIn: (state) => !!state.token,
    hasRole: (state) => (role) => state.roles.includes(role)
  },
  
  actions: {
    async login(username, password) {
      const { token, roles } = await api.login(username, password)
      this.token = token
      this.roles = roles
    },
    
    logout() {
      this.token = ''
      this.roles = []
    }
  }
})`,
      tags: ['Vue3', 'Pinia', '状态管理'],
      version: '1.0.0'
    },
    {
      id: 5,
      title: '响应式数据处理',
      description: '使用 Vue3 的响应式系统处理复杂数据',
      language: 'javascript',
      code: `
import { reactive, computed, watch } from 'vue'

export function useDataProcessor(initialData) {
  const state = reactive({
    data: initialData,
    filters: {},
    sortBy: null
  })
  
  const filteredData = computed(() => {
    let result = [...state.data]
    
    // 应用过滤
    Object.entries(state.filters).forEach(([key, value]) => {
      result = result.filter(item => item[key] === value)
    })
    
    // 应用排序
    if (state.sortBy) {
      result.sort((a, b) => a[state.sortBy] - b[state.sortBy])
    }
    
    return result
  })
  
  watch(filteredData, (newValue) => {
    console.log('数据已更新:', newValue)
  })
  
  return {
    state,
    filteredData
  }
}`,
      tags: ['Vue3', '响应式', '数据处理'],
      version: '1.0.0'
    }
  ],

  // 教育背景
  education: [
    {
      period: '2009 - 2013',
      degree: '电气工程及其自动化',
      school: '宁波某大学',
      description: '主修课程：电路原理、数字电子技术、自动控制原理‌、现代控制理论‌等'
    }
  ],
  
  // 技能图谱
  skills: {
    frontend: [
      { name: 'Vue.js', level: 90 },
      { name: 'JavaScript', level: 85 },
      { name: 'TypeScript', level: 70 },
      { name: 'HTML/CSS', level: 85 }
    ],
    backend: [
      { name: 'Asp.NET', level: 80 },
      { name: 'C#', level: 75 },
      { name: 'Redis', level: 70 },
      { name: 'SQLServer', level: 80 }
    ]
  },
  
  // 兴趣爱好
  interests: [
    {
      icon: '💻',
      title: '技术研究',
      description: '关注前沿技术动态，学习新的开发技术'
    },
    {
      icon: '📚',
      title: '技术写作',
      description: '分享技术心得，输出技术文章'
    },
    {
      icon: '🎮',
      title: '游戏开发',
      description: '业余时间了解小游戏开发'
    }
  ]
}) 